#include <fstream>
#include "big_int.h"

int main()
{
	std::ifstream input("in.txt");
	std::ofstream output("out.txt");

	big_int a, b;
	while (input >> a >> b)
	{
		if (b == big_int(0))
		{
			output << "<error>" << '\n' << '\n';
		} else
		{
			output << (a / b) << '\n' << (a % b) << '\n';
		}
	}
	return 0;
}